home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / VISUALBA / DATAEX.ZIP / GRIDSAMP.FRM < prev   
Text File  |  1993-07-06  |  4KB  |  155 lines

  1. VERSION 2.00
  2. Begin Form Form2 
  3.    Caption         =   "Grid Example"
  4.    ClientHeight    =   3375
  5.    ClientLeft      =   900
  6.    ClientTop       =   2550
  7.    ClientWidth     =   8475
  8.    Height          =   3780
  9.    Left            =   840
  10.    LinkTopic       =   "Form2"
  11.    ScaleHeight     =   3375
  12.    ScaleWidth      =   8475
  13.    Top             =   2205
  14.    Width           =   8595
  15.    Begin SpinButton Spin2 
  16.       Height          =   615
  17.       Left            =   6840
  18.       Top             =   480
  19.       Width           =   735
  20.    End
  21.    Begin SpinButton Spin1 
  22.       Height          =   615
  23.       Left            =   4800
  24.       Top             =   480
  25.       Width           =   735
  26.    End
  27.    Begin CommandButton cmdReturn 
  28.       Caption         =   "Return"
  29.       Height          =   495
  30.       Left            =   4800
  31.       TabIndex        =   1
  32.       Top             =   1680
  33.       Width           =   1815
  34.    End
  35.    Begin Grid Grid1 
  36.       Cols            =   3
  37.       Height          =   735
  38.       Left            =   600
  39.       Rows            =   3
  40.       ScrollBars      =   0  'None
  41.       TabIndex        =   0
  42.       Top             =   360
  43.       Width           =   3495
  44.    End
  45.    Begin Label Label2 
  46.       Caption         =   "Next/Prior Frame"
  47.       Height          =   255
  48.       Left            =   6840
  49.       TabIndex        =   3
  50.       Top             =   120
  51.       Width           =   1455
  52.    End
  53.    Begin Label Label1 
  54.       Caption         =   "Next/Prior Record"
  55.       Height          =   255
  56.       Left            =   4800
  57.       TabIndex        =   2
  58.       Top             =   120
  59.       Width           =   1695
  60.    End
  61. End
  62. Option Explicit
  63.  
  64. Sub cmdReturn_Click ()
  65.     Unload form2
  66.     form1.Data1.Recordset.MoveFirst
  67.     form1.Show
  68. End Sub
  69.  
  70. Sub spin1_spindown ()
  71.     Dim i As Integer
  72.     
  73.     On Error Resume Next
  74.     
  75.     'First, try and move next. If we're currently on the last record
  76.     'EOF will be detected, so the code really can't advance next.
  77.     'So, just restore the position to the last record, beep, and
  78.     'get out of here.
  79.     form1.Data1.Recordset.MoveNext
  80.     If form1.Data1.Recordset.EOF Then
  81.         Beep
  82.         form1.Data1.Recordset.MoveLast
  83.         Exit Sub
  84.     End If
  85.         
  86.     'Otherwise, back up, but not off the beginning of the database.
  87.     For i = 1 To FRAME_SIZE - 1
  88.         form1.Data1.Recordset.MovePrevious
  89.         If form1.Data1.Recordset.BOF Then
  90.             form1.Data1.Recordset.MoveFirst
  91.             Exit For
  92.         End If
  93.     Next i
  94.     
  95.     'Now that we're positioned on the correct record, display the frame.
  96.     LoadFrame
  97. End Sub
  98.  
  99. Sub Spin1_SpinUp ()
  100.     Dim i As Integer
  101.     
  102.     On Error Resume Next
  103.     
  104.     For i = 1 To FRAME_SIZE
  105.         form1.Data1.Recordset.MovePrevious
  106.         If form1.Data1.Recordset.BOF Then
  107.             Beep
  108.             form1.Data1.Recordset.MoveFirst
  109.             Exit For
  110.         End If
  111.     Next i
  112.     
  113.     LoadFrame
  114. End Sub
  115.  
  116. Sub Spin2_SpinDown ()
  117.     Dim i As Integer
  118.     
  119.     On Error Resume Next
  120.     
  121.     'First, try and move next. If we're currently on the last record
  122.     'EOF will be detected, so the code really can't advance next.
  123.     'So, just restore the position to the last record, beep, and
  124.     'get out of here.
  125.     form1.Data1.Recordset.MoveNext
  126.     If form1.Data1.Recordset.EOF Then
  127.         Beep
  128.         form1.Data1.Recordset.MoveLast
  129.         Exit Sub
  130.     End If
  131.         
  132.     'Now that we're positioned on the correct record, display the frame.
  133.     LoadFrame
  134.  
  135. End Sub
  136.  
  137. Sub Spin2_SpinUp ()
  138.     Dim i As Integer
  139.     
  140.     On Error Resume Next
  141.     
  142.     For i = 1 To FRAME_SIZE * 2 - 1
  143.         form1.Data1.Recordset.MovePrevious
  144.         If form1.Data1.Recordset.BOF Then
  145.             Beep
  146.             form1.Data1.Recordset.MoveFirst
  147.             Exit For
  148.         End If
  149.     Next i
  150.     
  151.     LoadFrame
  152.  
  153. End Sub
  154.  
  155.